import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

public class Solution1207 {
    public boolean uniqueOccurrences(int[] arr) {
        Map<Integer,Integer> map=new HashMap<>();
        for (int i : arr) {
            map.put(i,map.getOrDefault(i,0)+1);
        }
        Set<Integer> set=new HashSet<>();
        for (Integer value : map.values()) {
            if (set.contains(value)){
                return false;
            }else{
                set.add(value);
            }
        }
        return true;
    }

    public static void main(String[] args) {
        System.out.println(new Solution1207().uniqueOccurrences(new int[]{1,2,2,1,1,3}));
    }
}
